package com.example.controller;

import com.example.mall.Product;
import com.example.util.MockData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ProductController
 * @Description TODO
 * @Author: XMK
 * @Date: 2020/4/29 15:29
 * @Version: 1.0
 */
@RestController
public class ProductController {
    @GetMapping("/selectProductByOrderId/{orderId}")
    public Product selectProductByOrderId(@PathVariable String orderId) {
        System.out.println("orderId:::" + orderId);
        return MockData.getOneProduct();
    }

    @GetMapping("/selectProductByNo/{productNo}")
    public Product selectProductByNo(@PathVariable("productNo") String productNo) {
        System.out.println("productNo:::" + productNo);
        return MockData.getProduct(productNo);
    }

}
